import { S } from '../../s';
import { IPSAppDEField } from './ipsapp-defield';
import { IPSAppDERS } from './ipsapp-ders';
import { IPSAppDataEntity } from './ipsapp-data-entity';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSAppDERSImpl2 extends PSModelObjectImpl implements IPSAppDERS {
  get actionRSMode(): 0 | 1 | 2 {
    return this.M.actionRSMode;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get codeName2(): string {
    return this.M.codeName2;
  }

  get dataRSMode(): 1 | 2 | 4 | 8 {
    return this.M.dataRSMode;
  }

  get majorDECodeName(): string {
    return this.M.majorDECodeName;
  }

  get majorDECodeName2(): string {
    return this.M.majorDECodeName2;
  }

  get majorDEName(): string {
    return this.M.majorDEName;
  }

  protected majorpsappdataentity: IPSAppDataEntity;
  getMajorPSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.majorpsappdataentity ||
      (this.majorpsappdataentity = this.fillObjectModel(
        S._f,
        this.M.getMajorPSAppDataEntity,
        S._2c0,
      ) as IPSAppDataEntity)
    );
  }

  get minorDECodeName(): string {
    return this.M.minorDECodeName;
  }

  get minorDECodeName2(): string {
    return this.M.minorDECodeName2;
  }

  get minorDEName(): string {
    return this.M.minorDEName;
  }

  protected minorpsappdataentity: IPSAppDataEntity;
  getMinorPSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.minorpsappdataentity ||
      (this.minorpsappdataentity = this.fillObjectModel(
        S._f,
        this.M.getMinorPSAppDataEntity,
        S._2c1,
      ) as IPSAppDataEntity)
    );
  }

  get parentFilter(): string {
    return this.M.parentFilter;
  }

  protected parentpsappdefield: IPSAppDEField;
  getParentPSAppDEField(): IPSAppDEField | null {
    if (this.parentpsappdefield != null) return this.parentpsappdefield;
    const value = this.M.getParentPSAppDEField;
    if (value == null) {
      return;
    }
    this.parentpsappdefield =
      this.getMinorPSAppDataEntity().findPSAppDEField(value);
    return this.parentpsappdefield;
  }

  get rSMode(): 1 | 2 {
    return this.M.rSMode;
  }

  get tempDataOrder(): number {
    return this.M.tempDataOrder != null ? this.M.tempDataOrder : -1;
  }

  get array(): boolean {
    return this.M.array != null ? this.M.array : true;
  }

  get enableCreateDataRS(): boolean {
    return this.M.enableCreateDataRS != null
      ? this.M.enableCreateDataRS
      : false;
  }

  get enableGetDataRS(): boolean {
    return this.M.enableGetDataRS != null ? this.M.enableGetDataRS : false;
  }

  get enableSelectDataRS(): boolean {
    return this.M.enableSelectDataRS != null
      ? this.M.enableSelectDataRS
      : false;
  }

  get enableUpdateDataRS(): boolean {
    return this.M.enableUpdateDataRS != null
      ? this.M.enableUpdateDataRS
      : false;
  }

  get majorDEMajor(): boolean {
    return this.M.majorDEMajor != null ? this.M.majorDEMajor : true;
  }
  get cls(): string {
    return 'PSAppDERSImpl2';
  }
  instanceof(cls: string): boolean {
    if (cls == S._e) return true;
    return super.instanceof(cls);
  }
}
